package com.hhd.pdf.components.innertable;

import com.hhd.pdf.CommonUtils;
import lombok.Getter;
import lombok.Setter;
import org.dom4j.Attribute;
import org.dom4j.Element;


@Getter
@Setter
public class InnerColumn {

    private final String title;
    private final String dataIndex;
    private final boolean bodySlot;
    private final Element element;

    public InnerColumn(Element col) {
        Attribute title = col.attribute("title");
        this.title = title.getText();

        Attribute dataIndex = col.attribute("dataIndex");
        this.dataIndex = dataIndex.getText();

        bodySlot = !CommonUtils.isEmpty(col.content());
        this.element = col;
    }
}
